package com.neuedu.corejava.ch6.practise;

public class Sanjiaoxing {

	int a;
	int b;
    int c;
	

	public Sanjiaoxing() {
		super();
	}

	public Sanjiaoxing(int a, int b, int c) {
		super();
		this.a = a;
		this.b = b;
		this.c = c;
	}

	public int getA() {
		return a;
	}

	public void setA(int a) {
		if(a<0) {
			System.out.println("你家边长能小于零？");
		}else {
			this.a = a;
		}
		
	}

	public int getB() {
		return b;
	}

	public void setB(int b) {
		if(b<0) {
			System.out.println("你家边长能小于零？");
		}else {
			this.b = b;
		}
		
	}

	public int getC() {
		return c;
	}

	public void setC(int c) {
		if(c<0) {
			System.out.println("你家边长能小于零？");
		}else{
			this.c = c;
		}	
	}
	
	private int sum(int sum) {
		return sum;
	}
	
	  public  void show(){
	       if((a+b)>c&&(a+c)>b&&(b+c)>a){
	           System.out.println("三边之和:"+sum(a+b+c));
	           System.out.println("a:"+a+"\nb:"+b+"\nc:"+c);
	       }
	    }


	public static void main(String[] args) {
		Sanjiaoxing san=new Sanjiaoxing(3,4,5);
		san.show();

	}

}
